package top.kaoshanji.p2ch10a;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

/**
 * 代码清单-p2ch10a-311页b：类继承时的静态域的初始化示例
 * author kaoshanji
 * ^_^
 * create time 2025/2/2 16:59
 */
public class StaticFieldInit {

    private static final Logger logger = LogManager.getLogger(StaticFieldInit.class);

    public static void main(String[] args) {
        logger.info("...代码清单-p2ch10a-311页b：类继承时的静态域的初始化示例...");
        System.out.println(B.value);
    }

}

class A {

    static int value = 100;
    static {
        System.out.println("类A初始化。");
    }

}

class B extends A {

    static {
        System.out.println("类B初始化。");
    }

}
